<template>
	<view class="container">
		<m-header class="top" :list="adDatas"></m-header>
		<view class="shuzi u-m-t-20">
			<view class="count u-p-t-36 u-p-b-10 u-flex u-row-center">
				<u-count-to class="count-to" ref="uCountTo" :autoplay="autoplay" :startVal="startVal" :endVal="endVal" :duration="duration"
				 :decimals="decimals" :bold="bold" :fontSize="fontSize" :color="color"></u-count-to>
				<text class="u-m-l-10">名优秀伙伴为您服务</text>
			</view>

			<u-form :model="model" :rules="rules" ref="uForm" :errorType="errorType">
				<u-form-item class="group" :label-width="200" :border-bottom="false" :label-position="labelPosition"
				 label="我是" prop="ws">
					<u-input :border="border" type="select" :select-open="selectShowWs" v-model="model.iam" placeholder="请选择"
					 placeholderStyle="color: #4B9CFF;" input-align="right" @click="selectShowWs = true"></u-input>
				</u-form-item>
				<u-form-item class="group" :label-width="200" :border-bottom="false" :label-position="labelPosition"
				 label="我需要" prop="demand">
						<view style="width:100%;text-align: right;color: #4B9CFF;"  @click="toimean">{{model.demand.lb || "请选择"}}</view>
				</u-form-item>
				<u-form-item class="group" :label-width="200" :border-bottom="false" :label-position="labelPosition"
				 label="我意向" prop="ineed">
				 <view style="width:100%;text-align: right;color: #4B9CFF;"  @click="handleWyx"><u-icon name="arrow-right" style="color:#9DA2B0;font-size: 32upx;"></u-icon></view>
			<!-- 		<picker @change="bindPickerPpdxChange" :value="zindex" :range="ppdxs" style="width:100%;text-align: right;">
						<view style="color: #4B9CFF;" class="uni-input">{{model.ineed || "请选择"}}</view>
					</picker> -->
				</u-form-item>
				<view v-if="model.demand != ''" class="">
					<u-gap :bg-color="bgColor" :height="height" :margin-top="marginTop"></u-gap>
					<u-form-item v-if="model.iam == '智汇团队'" class="u-m-l-30 u-m-r-40" :label-width="200" :label-position="labelPosition"
					 label="团队" prop="hdjf">
						<u-input type="select" v-model="model.demand.team" placeholder="请选择" placeholderStyle="color: #0D1D36;"
						 input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" label-width="200" :label-position="labelPosition"
					 label="匹配对象" prop="ppdx">
					<u-input :border="border" type="select" v-model="model.demand.ppdx" placeholder="请选择" placeholderStyle="color: #0D1D36;"
					 input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" label-width="200" :label-position="labelPosition" label="类别" prop="lb">
						<u-input :border="border" type="select" v-model="model.demand.lb" placeholder="请选择" placeholderStyle="color: #0D1D36;"
						 input-align="right"></u-input>
					</u-form-item>
				
					<u-form-item class="u-m-l-30 u-m-r-30" label-width="200" :label-position="labelPosition" label="诚信保证金" prop="integrityDeposit">
						<u-input :border="border" placeholder="" v-model="model.demand.integrityDeposit" type="text" input-align="right"></u-input>元
					</u-form-item>
					<view class="qtsm u-m-l-40 u-m-r-30 u-m-t-40">
						<text class="hz">简短说明</text>
					</view>
					<u-form-item class="  zwpj u-m-l-30 u-m-r-30 "  :label-position="labelPosition" prop="jdsm">
						<u-input type="textarea" :border="border" placeholder="请输入简短说明" v-model="model.demand.jdsm" />
					</u-form-item>
				</view>
				<block v-if="model.intention != '' && model.demand.ppdx =='企业'">
					
					<u-gap :bg-color="bgColor" :height="height" :margin-top="marginTop" ></u-gap>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition" :border-bottom="true" label="地域" prop="area">
						<u-input type="select"  v-model="model.intention.area" placeholder="请选择" placeholderStyle="color: #0D1D36;"
						 input-align="right" ></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition" :border-bottom="true" label="企业领域" prop="corporateIdentity">
						<view style="width:100%;text-align: right;">{{model.intention.corporateIdentity || "请选择"}}</view>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" :label-position="labelPosition" label="企业性质" prop="enterpriseNature">
						<u-input
							type="select"
							v-model="model.intention.enterpriseNature"
							placeholder="请选择"
							placeholderStyle="color: #0D1D36;"
							input-align="right"
						></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition" :border-bottom="true" label="擅长领域" prop="enterpriseField">
						<u-input :border="border" type="select" v-model="model.intention.enterpriseField" placeholder="请选择" placeholderStyle="color: #0D1D36;"
						 input-align="right" ></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition" :border-bottom="true" label="企业资质" prop="qualification">
						<u-input :border="border" type="select"  v-model="model.intention.qualification" placeholder="请选择" placeholderStyle="color: #0D1D36;"
						 input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" label-width="200" :label-position="labelPosition" label="质量体系" prop="quality">
						<u-input :border="border" placeholder="请输入" v-model="model.intention.quality" type="text" input-align="right"></u-input>
					</u-form-item>
					<u-form-item v-if="model.intention.zsbzj == '需要'" class="u-m-l-30 u-m-r-30" label-width="200" :label-position="labelPosition" label="诚信保证金" prop="integrityDeposit">
						<u-input :border="border" placeholder="请输入保证金金额  元" v-model="model.intention.integrityDeposit" type="text" input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" label-width="200" :label-position="labelPosition" label="履约信誉" prop="performanceReputation">
						<u-input :border="border" placeholder="请输入" v-model="model.intention.performanceReputation" type="text" input-align="right"></u-input>
					</u-form-item>
				</block>
				<block v-if="model.intention != '' && model.demand.ppdx =='个人'">
					<u-gap :bg-color="bgColor" :height="height" :margin-top="marginTop"></u-gap>
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" label="产业" prop="industry">
						<view style="width:100%;text-align: right;">{{model.intention.industry || "请选择"}}</view>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" label="个人身份" prop="userIdentify">
						<view style="width:100%;text-align: right;">{{model.intention.userIdentify || "请选择"}}</view>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" v-if="model.intention.specialty != ''" label="具体身份" prop="specialty">
						<view style="width:100%;text-align: right;">{{model.intention.specialty || "请选择"}}</view>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" label="职称" prop="profession">
						<view class="value" style="width:100%;text-align: right;">{{model.intention.profession || "请选择职称"}}</view>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" label="执业资格" prop="credentials">
						<view class="value" style="width:100%;text-align: right;">{{model.intention.credentials || "请选择职称"}}</view>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" label="擅长领域" prop="expertise">
						<view style="width:100%;text-align: right;">{{model.intention.scly || "请选择"}}</view>
					</u-form-item>		
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" label="专业方向" prop="professional">
						<view style="width:100%;text-align: right;">{{model.intention.professional || "请选择"}}</view>
					</u-form-item>				
									
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
					 :border-bottom="true" label="性别" prop="gender">
						<view class="value" style="width:100%;text-align: right;">{{model.intention.gender || "性别"}}</view>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
					 :border-bottom="true" label="人数" prop="num">
						<view class="value" style="width:100%;text-align: right;">{{model.intention.num}}</view>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition"
					 :border-bottom="true" label="学历" prop="requireEdu">
						<view class="value" style="width:100%;text-align: right;">{{model.intention.requireEdu}}</view>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-position="labelPosition" label="在职情况"
					 label-width="490" prop="incumbency">
						<view class="value" style="width:100%;text-align: right;">{{model.intention.incumbency}}</view>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" label-width="200"  label="工作年限" prop="workingSeniority">
						<view style="width:100%;text-align: right;">{{model.intention.workingSeniority || "请选择"}}</view>
					</u-form-item>	
				</block>
				<block v-if="model.intention != '' && model.demand.ppdx =='团队'">
					<u-gap :bg-color="bgColor" :height="height" :margin-top="marginTop"></u-gap>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition" :border-bottom="true" label="地域" prop="area">
						<u-input type="select"  v-model="model.intention.area" placeholder="请选择" placeholderStyle="color: #0D1D36;"
						 input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" :label-position="labelPosition" label="团队类型" prop="enterpriseNature">
						<view style="width:100%;text-align: right;">{{model.intention.grsf || "请选择"}}</view>						
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" :label-width="200" :label-position="labelPosition" :border-bottom="true" label="擅长领域" prop="enterpriseField">
						<view style="width:100%;text-align: right;">{{model.intention.enterpriseField || "请选择"}}</view>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" label="产业" prop="industry">
						<view style="width:100%;text-align: right;">{{model.intention.industry || "请选择"}}</view>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" label="身份" prop="userIdentify">
						<view style="width:100%;text-align: right;">{{model.intention.userIdentify || "请选择"}}</view>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" label="具体身份" prop="specialty">
						<view style="width:100%;text-align: right;">{{model.intention.specialty || "请选择"}}</view>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" label="职称" prop="profession">
						<view class="value" style="width:100%;text-align: right;">{{model.intention.profession || "请选择"}}</view>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :label-width="200" label="团长执业资格" prop="credentials">
						<view class="value" style="width:100%;text-align: right;">{{model.intention.credentials || "请选择"}}</view>
					</u-form-item>					
					<u-form-item v-if="model.intention.integrityDeposit > 0" class="u-m-l-30 u-m-r-30" label-width="200" :label-position="labelPosition" label="" prop="integrityDeposit">
						<u-input :border="border" placeholder="请输入保证金金额  元" v-model="model.intention.integrityDeposit" type="text" input-align="right"></u-input>
					</u-form-item>
					<u-form-item class="u-m-l-30 u-m-r-30" :required="required" label-width="200" :label-position="labelPosition" label="履约信誉" prop="lvxy">	
							<view class="value" style="width:100%;text-align: right;">{{model.intention.lvxy || ""}}</view>
					</u-form-item>
				</block>
					<u-gap :bg-color="bgColor" :height="height" :margin-top="marginTop"></u-gap>
				<u-form-item class="u-m-l-30 u-m-r-30" label-width="200" :label-position="labelPosition" label="智汇N+1名称" prop="bestKey">
					<u-input :border="border" placeholder="请输入" v-model="model.name" type="text" input-align="right"></u-input>
				</u-form-item>
				<u-form-item class="u-m-l-30 u-m-r-30" label-width="200" :label-position="labelPosition" label="关键字" prop="bestKey">
					<u-input :border="border" placeholder="请输入" v-model="model.bestKey" type="text" input-align="right"></u-input>
				</u-form-item>
				<u-form-item class="u-m-l-30 u-m-r-30" label-width="200" :label-position="labelPosition" label="屏蔽关键字" prop="blackKey">
					<u-input :border="border" placeholder="请输入" v-model="model.blackKey" type="text" input-align="right"></u-input>
				</u-form-item>
				<u-form-item class="u-m-l-30 u-m-r-40" :label-width="200" :label-position="labelPosition" label="匹配时效" prop="expiryTime">
					<u-input :border="border" @click="show = true" placeholder="请选择" v-model="model.expiryTime" type="text" input-align="right"></u-input>
					<u-calendar v-model="show" ref="calendar" @change="change" mode="date"
						:start-text="startText" :end-text="endText" :range-color="rangeColor" max-date="2022-10-01"
						:range-bg-color="rangeBgColor" :active-bg-color="activeBgColor"
					>
					</u-calendar>
				</u-form-item>				
				<u-form-item class="u-m-l-30 u-m-r-40" :label-width="200" :label-position="labelPosition" :border-bottom="false" label="匹配权重" prop="customize">
					<view style="flex: 1;text-align: right;" @click="handleClickWeight()">
						<u-icon name="arrow-right" style="color:#9DA2B0;font-size: 32upx;"></u-icon>
					</view>
				</u-form-item>
			</u-form>
		</view>
		<view class="u-flex u-row-center u-m-t-50">
			<view class="dianone"></view>
			<view class="diantwo"></view>
			<text class="hrxz u-m-l-20 u-m-r-20">互认须知</text>
			<view class="diantwo"></view>
			<view class="dianone"></view>
		</view>
		<view class="u-m-t-30 xuhi">
			<view class="u-m-l-30 u-m-b-20"> 1.互认机制为高级会员专享服务;</view>
			<view class="u-m-l-30 u-m-b-20">2.互认机制为供需双方提供更广阔合作平台，请自觉遵守相关法律及行业规范;</view>
			<view class="u-m-l-30 u-m-b-20">3.为减少垃圾信息，日均邀请上限3次，每次可加多个对象;</view>
			<view class="u-m-l-30 u-m-b-20">4.互认机制说明（仅对会员开放）;</view>
		</view>
		<u-gap :bg-color="bgColor" :height="height" :margin-top="marginTop"></u-gap>
		<view class="warp u-m-t-20 u-p-30">
			<u-button class="button" @click="submit">马上为我匹配</u-button>
			<!--弹出框-->
			<u-select mode="single-column"  value-name="id" label-name="name" :list="wsList1" v-model="selectShowWs" @confirm="selectConfirmWs"></u-select>
			<u-select mode="single-column" :list="wxyList1" v-model="selectShowWxy" @confirm="selectConfirmWxy"></u-select>
			<u-select mode="single-column" :list="wyxList1" v-model="selectShowWyx" @confirm="selectConfirmWyx"></u-select>
			<u-select mode="single-column" :list="fetchDict.service_type"  value-name="id" label-name="name" v-model="selectShowFwnr" @confirm="selectConfirmFwnr"></u-select>			
			<u-select mode="single-column" :list="dataList" v-model="selectShowexpiryTime" @confirm="selectConfirmexpiryTime"></u-select>
			<u-picker mode="region" v-model="pickerShow" @confirm="regionConfirm"></u-picker>
			<!--弹出框-->
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			let that = this;
			return {
				adDatas:[],
				zindex:0,
				ppdxs:["请选择","个人","企业","团队"],
				height: 20,
				bgColor: this.$u.color.bgColor,
				marginTop: 30,
				marginBottom: 30,
				selectShowFwlx:false,
				fetchDict:[],
				show: false,
				mode: 'range',
				result: "请选择日期",
				startText: '开始',
				endText: '结束',
				rangeColor: '#2979ff',
				rangeBgColor: 'rgba(41,121,255,0.13)',
				activeBgColor: '#2979ff',
				btnType: 'primary',
				zsbzj: false,
				radio:'',
				radio1: '',
				radioCheckWidth: 'auto',
				radioCheckWrap: false,
				/**
				 * form验证
				 * */
				model: {
					demand:'',
					intention:''
				},
				selectList: [],
				dataList: [],
				wsList:[],
				wxyList:[],
				wyxList:[],
				wxyList1:[
					{
						value: '服务内容',
						label: '服务内容'
					},
				],
				wsList1:[],
				wyxList1:[
					{
						value: '个人服务',
						label: '个人服务'
					},
					{
						value: '企业服务',
						label: '企业服务'
					},
				],
				checkboxListTwo: [

					{
						name: '需要',
						checked: false,
						disabled: false
					},
					{
						name: '不需要',
						checked: false,
						disabled: false
					},
				],
				rules: {
					
				},
				ryyq: false,
				qyyq: false,
				wyx1: 0,
				params: {},
				required: false,
				border: false,
				check: false,
				region: '',
				selectStatus: 'close',
				selectShowZyp: false,
				selectShowWs: false,
				selectShowWxy: false,
				selectShowWyx: false,
				selectShowFwnr: false,
				selectShowexpiryTime: false,
				selectShowLyxy: false,
				pickerShow: false,
				labelPosition: 'left',
				codeTips: '',
				errorType: ['toast'],
				/**/

				/**
				 * 数字统计
				 * */
				startVal: 500,
				endVal: 500,
				separator: ',',
				decimals: 0,
				duration: 2000,
				autoplay: true,
				useEasing: true,
				current: 3,
				isStop: false,
				bold: false,
				fontSize: 24,
				color: '#fff',
				/**/
				keyIndex: 0,
				keywords: [{
					name: '企业',
					selected: true
				}, {
					name: '设计师',
					selected: false
				}, {
					name: '监理',
					selected: false
				}, {
					name: '大型企业',
					selected: false
				}, {
					name: '采购',
					selected: false
				}, {
					name: '监理',
					selected: false
				}]
			};
		},
		mounted() {},
		onLoad(options){
			if(options.data){
				let data = JSON.parse(decodeURIComponent(options.data));
				console.log("data",data);
				this.model = data;
				this.model.imean = data.mode;
				
				console.log("model",this.model);
			}	
			if(options.row){
				this.model = JSON.parse(decodeURIComponent(options.row));
				console.log("row",this.model);
			}
			this.getFetchUserExtra();
			this.wsDictionary();
			this.wxyDictionary();
			this.wyxDictionary();
			this.dictionaryFetchDict('service_type'); //服务类型
			
			this.findfetchAd(2);
			this.findextraIndex();
		},
		onShow(){
		},
		onReady() {
			this.$refs.uForm.setRules(this.rules);
		},
		methods: {											
			async findextraIndex(){
				let result = await this.$apis.extraIndex();
				this.endVal = this.endVal + result.data;
			},	
			async findfetchAd(type){
				let result = await this.$apis.fetchAd({type:type});
				this.adDatas = result.data;
			},			
			bindPickerPpdxChange(e){
				console.log(e.detail.value)
				this.zindex = e.detail.value;
				this.model.ineed = this.ppdxs[e.detail.value];
				let url = encodeURIComponent(JSON.stringify("wisdomcommune/zhihuinjy"));
				if (this.zindex == 2) {
					uni.navigateTo({
						url:"/pages/wisdomcommune/njySelect/wyxContent?type="+url+"&row="+encodeURIComponent(JSON.stringify(this.model))
					})
				}else if (this.zindex == 3) {
					uni.navigateTo({
						url:"/pages/wisdomcommune/njySelect/teamWyxContent?type="+url+"&row="+encodeURIComponent(JSON.stringify(this.model))
					})
				} else {
					uni.navigateTo({
						url: "/pages/wisdomcommune/njySelect/personalWyxContent?type="+url+"&row=" + encodeURIComponent(JSON.stringify(this.model))
					})
				}
			},
			handleWyx(){
				console.log("ppdx",this.model.demand.ppdx);
				if(this.model.demand === undefined || ( this.model.demand.ppdx === undefined || this.model.demand.ppdx == "请选择")){
					uni.showToast({
						title:"请先选择我需要中的匹配对象",
						icon:'none'
					})
					return;
				}
				let identity = this.$store.state.userInfo.identityType;
				let url = encodeURIComponent(JSON.stringify("wisdomcommune/zhihuinjy"));
				if(this.model.demand !== ''){
					if (this.model.demand.ppdx == '企业') {
						uni.navigateTo({
							url:"/pages/wisdomcommune/njySelect/wyxContent?type="+url+"&row="+encodeURIComponent(JSON.stringify(this.model))
						})
					}else if (this.model.demand.ppdx == '团队') {
						uni.navigateTo({
							url:"/pages/wisdomcommune/njySelect/teamWyxContent?type="+url+"&row="+encodeURIComponent(JSON.stringify(this.model))
						})
					} else {
						uni.navigateTo({
							url: "/pages/wisdomcommune/njySelect/personalWyxContent?type="+url+"&row=" + encodeURIComponent(JSON.stringify(this.model))
						})
					}					
				}else{
					uni.showToast({
						title: '请先选择我需要',
						icon: 'none'
					});
				}
			},
			toimean(){
				if(this.model.iam === undefined){
					uni.showToast({
						title:"请选择我是",
						icon:"none"
					})
				}else{					
					let url = encodeURIComponent(JSON.stringify("wisdomcommune/zhihuinjy"));
					uni.navigateTo({
						url: '../wisdomcommune/njySelect/wxyContent?type='+url+'&row=' + encodeURIComponent(JSON.stringify(this.model))
					})
				}
			},
			async getFetchUserExtra(){
				let result = await this.$apis.fetchUserExtra({type:0});
				this.wsList1 = result.data;
			},
			handleClickWeight(e) {
				var model = encodeURIComponent(JSON.stringify(this.model));
				let url = encodeURIComponent(JSON.stringify("wisdomcommune/zhihuinjy"));
				if(this.model.demand.ppdx == '企业'){				
					uni.navigateTo({
						url: '../user/companyWeight?type='+url+'&row=' + model
					})
				}else if(this.model.demand.ppdx == '团队'){
					uni.navigateTo({
						url: '../user/teamWeight?type='+url+'&row=' + model
					})
				}else{				
					uni.navigateTo({
						url: '../user/personWeight?type='+url+'&row=' + model
					})
				}
			},
			async dictionaryFetchDict(keyWords){
				let result = await this.$apis.fetchDict({keyWords:keyWords});
				this.fetchDict[keyWords] = result.data;		
			},
			toAdd(){
				if(this.qyyq){
					let data = this.model;
					data.type = "fuwu";
					let query = encodeURIComponent(JSON.stringify(data))
					uni.navigateTo({
						url:"/pages/wisdomcommune/enterpriseAsk?data="+query
					})
				}else if(this.ryyq){
					let data = this.model;
					data.type = "fuwu";
					let query = encodeURIComponent(JSON.stringify(data))
					uni.navigateTo({
						url:"/pages/wisdomcommune/personAsk?data="+query
					})
				}
				
			},
			// checkbox选择发生变化
			checkboxGroupChange(e) {
				// debugger
				if(e==="需要"){
					this.zsbzj = true;
				}else{
					this.zsbzj = false;
				}
				
			},
			submit() {
				this.$refs.uForm.validate(valid => {
					if (valid) {
						console.log('验证通过');
						if(this.model.demand == ''){
							uni.showToast({
									title: "请选择我需要",
									icon: 'none'
							});
							return;
						}
						if(this.model.intention == ''){
							uni.showToast({
									title: "请选择我意向",
									icon: 'none'
							});
							return;
						}
						this.matching();
					} else {
						console.log('验证失败');
					}
				});
			},
			//服务匹配并新增
			async matching(){
				console.log('this.model',this.model)
				try {
				let reqBody = {};
				reqBody['name'] = this.model.name;
				reqBody['bestKey'] = this.model.bestKey;
				reqBody['blackKey'] = this.model.blackKey;
				reqBody['expiryTime'] = this.model.expiryTime;
				reqBody['iam'] = this.model.iam;
				reqBody['demand'] = this.model.demand;
				reqBody['ineed'] = this.model.ineed; //我意向，选择身份用
				reqBody['intention'] = this.model.intention;
				reqBody['weight'] = this.model.weight;
				let data = await this.$apis.njyMatching(reqBody);
				if(data.code == 200){
					uni.showToast({
							title: "服务匹配成功",
							icon: 'none'
					});
					setTimeout(() => {
						this.$mRouter.switchTab({
							route:this.$mRoutesConfig.message
						});
					},2000)
					
				}else{
					uni.showToast({
						title: result.msg,
						icon: 'none'
					});
					return;
				}
				} catch (e) {
					console.log(e);
					this.submitBtnDis = false;
				}
			},
			//查询匹配 我是  字典数据
			async wsDictionary(){
				let reqBody = {};
				reqBody['primary'] = "招投标";
				reqBody['secondary'] = "我是";
				let result = await this.$apis.findMatchingDictionary(reqBody);
				let list = result.data;
				for (let i = 0; i < list.length; i++) {
					let wsValue = {};
					wsValue['value'] = list[i].name;
					wsValue['label'] = list[i].name;
					this.wsList.push(wsValue)
				}
			},
			//查询匹配 我需要  字典数据
			async wxyDictionary(){
				let reqBody = {};
				reqBody['primary'] = "招投标";
				reqBody['secondary'] = "我需要";
				let result = await this.$apis.findMatchingDictionary(reqBody);
				let list = result.data;
				for (let i = 0; i < list.length; i++) {
					let wxyValue = {};
					wxyValue['value'] = list[i].name;
					wxyValue['label'] = list[i].name;
					this.wxyList.push(wxyValue)
				}
			},
			//查询匹配 我意向  字典数据
			async wyxDictionary(){
				let reqBody = {};
				reqBody['primary'] = "招投标";
				reqBody['secondary'] = "我意向";
				let result = await this.$apis.findMatchingDictionary(reqBody);
				let list = result.data;
				for (let i = 0; i < list.length; i++) {
					let wyxValue = {};
					wyxValue['value'] = list[i].name;
					wyxValue['label'] = list[i].name;
					this.wyxList.push(wyxValue)
				}
			},
			selectKey(e) {
				this.keywords[e].selected = !this.keywords[e].selected;
			},
			// 选择地区回调
			regionConfirm(e) {
				this.model.region = e.province.label + '-' + e.city.label + '-' + e.area.label;
			},
			// 选择
			selectConfirmWs(e) {
				this.model.iam = '';
				e.map((val, index) => {
					this.model.iam += this.model.iam == '' ? val.label : '-' + val.label;
				});
			},
			selectConfirmWxy(e) {
				if(e[0].value == '服务内容'){
					uni.navigateTo({
						url:"/pages/wisdomcommune/njySelect/wxyContent"
					})
				}
				this.model.wxy = '';
				e.map((val, index) => {
					this.model.wxy += this.model.wxy == '' ? val.label : '-' + val.label;
				});
			},
			selectConfirmWyx(e) {
				if(e[0].value == "个人服务"){
					uni.navigateTo({
						url:"/pages/wisdomcommune/njySelect/personalWyxContent"
					})
					// this.wyx1 = 0
					// this.ryyq = true
					// this.qyyq = false
				}else if(e[0].value == "企业服务"){
					uni.navigateTo({
						url:"/pages/wisdomcommune/njySelect/wyxContent"
					})
					// this.wyx1 = 1
					// this.qyyq = true
					// this.ryyq = false
				}
				this.model.wyx = '';
				e.map((val, index) => {
					this.model.wyx += this.model.wyx == '' ? val.label : '-' + val.label;
				});
			},
			selectConfirmFwnr(e) {
				this.model.fwnr = '';
				e.map((val, index) => {
					this.model.fwnr += this.model.fwnr == '' ? val.label : '-' + val.label;
				});
			},
			selectConfirmexpiryTime(e) {
				this.model.expiryTime = '';
				e.map((val, index) => {
					this.model.expiryTime += this.model.expiryTime == '' ? val.label : '-' + val.label;
				});
			},
			change(e) {
				this.model.expiryTime = e.result;
				
			},
			dianji() {
				this.show = true;
			},
			selectConfirmQydy(e) {
				this.model.qydy = '';
				e.map((val, index) => {
					this.model.qydy += this.model.qydy == '' ? val.label : '-' + val.label;
				});
			}
		}
	};
</script>
<style scoped lang="scss">
	.container {
		background: #ffffff;
	}
	
	.top {
		width: 100%;
		height: 260rpx;
		background: $uni-bg-color-ad;
	
		.above {
			display: flex;
			justify-content: center;
			margin-left: -46rpx;
	
			.picture {
				width: 117.8rpx;
				height: 137.4rpx;
				margin-left: 46rpx;
				margin-top: 20rpx;
			}
		}
	
		.below {
			display: flex;
			justify-content: center;
			margin-left: -46rpx;
	
			.picture {
				width: 117.8rpx;
				height: 137.4rpx;
				margin-left: 46rpx;
				margin-top: 1rpx;
			}
		}
	}
	
	.count {
		margin-top: -50rpx;
		width: 100%;
		height: 100rpx;
		background: #FFFFFF;
		border-radius: 40rpx 40rpx 0rpx 0rpx;
	
		.count-to {
			font-size: 24rpx;
		}
	
		text {
			padding: 2rpx 12rpx;
			background: #ff9e21;
			color: #ffffff;
			font-size: 24rpx;
		}
	}
	
	.fgx {
		width: 100%;
		height: 20rpx;
		background-color: #F5F5F9;
		margin-top: 40rpx;
	}
	
	.fgx1 {
		width: 100%;
		height: 20rpx;
		background-color: #F5F5F9;
	}
	
	.group {
		padding: 6rpx 21rpx;
		background: #f1f7ff;
		border-radius: 6rpx;
		margin: 30rpx 30rpx 0 30rpx;
	}
	
	.button {
		width: 662rpx;
		margin: 130rpx auto 90rpx auto;
		background: #ab61ff;
		border-radius: 40rpx;
		border: 0;
		color: #fff;
	
		&.u-hairline-border:after {
			border: 0;
		}
	}
	
	.word {
		font-size: 36rpx;
		color: #0d1d36;
		font-weight: bold;
	}
	
	.list {
		width: 690rpx;
		// height: 428rpx;
		background: #FFFFFF;
		box-shadow: 0px 0px 17rpx 4rpx rgba(149, 146, 155, 0.17);
		border-radius: 20px;
		margin: 0 auto;
	
	
		.title {
			font-size: 34rpx;
			color: #0E1E36;
			font-weight: bold;
		}
	
	
		image {
			width: 36rpx;
			height: 32rpx;
		}
	
		.card {
			width: 312rpx;
			height: 139rpx;
			background-size: auto 100%;
			border: 1px dashed;
			padding: 20rpx;
			// padding: 100upx 75upx;
	
			.btn {
				width: 122rpx;
				height: 37rpx;
				background: #BABAF6;
				border-radius: 4rpx;
				color: #FFFFFF;
				font-size: 24rpx;
			}
	
			.btntwo {
				background: #F2C276;
			}
	
			.btnthree {
				background: #90d9c1;
			}
	
			.btnfour {
	
				background: #F0A4A3;
			}
	
			.titletwo {
				font-size: 36rpx;
				color: #8484CC;
			}
	
			.titlethree {
				color: #CB8438;
			}
	
			.titlefour {
				color: #90d9c1;
			}
	
			.titlefive {
				color: #CE7D7C;
			}
		}
	
	
	
	}
	
	.hrxz {
		font-size: 30rpx;
		font-weight: bold;
		color: #0D1D36;
	}
	
	.dianone {
		width: 14rpx;
		height: 14rpx;
		background: #AB61FF;
		opacity: 0.6;
		border-radius: 50%;
	
	}
	
	.diantwo {
		width: 14rpx;
		height: 14rpx;
		background: #AB61FF;
		border-radius: 50%;
	
	}
	
	.xuhi {
	
		font-size: 28rpx;
		color: #9DA2B0;
	}
	.qita{
		
		image{
			width: 29rpx;
			height: 29rpx;;
		}
	}
	.zwpj{
			width: 690rpx;
			height: 260rpx;
			background-color: #F5F5F9;
			font-size: 30rpx;
			color: #F5F5F9;
			border-radius: 10rpx;
			line-height: 44rpx;
		}
</style>
